1. Field of the Invention
The present invention generally relates to image correction processes, and more particularly to a contrast correction process and a gradation correction process of a digital image.
2. Description of the Related Art
A digital camera is equipped with an automatic exposure control mechanism for constantly maintaining an optimum exposure when photographing. There are various kinds of exposure control methods. However, generally, the aperture and shutter speed are adjusted by dividing a screen into a plurality of appropriate areas for detecting the light volume, and weighting each of the areas so as to obtain a weighted average of the light volume.
Generally, as scenes for photographing by a digital camera, the following are conceivable.                normal photographing: outdoor photographing without backlight and general photographing        backlit scene: photographing in a state where a light source exists behind an object        night portrait photographing: photographing using flash at night        night view photographing: photographing of a self-luminous object such as an illumination source        
In addition, exposure states include a “correct” state in which the exposure of an object is correct and an “underexposed” state in which the exposure of an object is deficient.
Each manufacturer employs an exposure control system for digital cameras. However, no perfect system exists since the exposure control system sometimes does not operate correctly depending on photographing conditions. As a result, contrast shortfalls and underexposure occur frequently.
In order to prevent an inappropriate contrast state when photographing to produce a digital image, Japanese Laid-Open Patent Application No. 10-198802 proposes a technique. That is, the luminance distribution is obtained for every pixel in image data. Thereafter, a dynamic range (a shadow point and a highlight point) is set by regarding a point obtained by subtracting a predetermined distribution ratio from the highest value of the luminance distribution as an upper limit, and a point obtained by adding the predetermined distribution ratio to the lowest value of the luminance distribution as a lower limit. Then, contrast correction is performed. Additionally, in order to perform correction corresponding to a scene, another technique is proposed in Japanese Laid-Open Patent Application No. 11-154235. In the technique, the scene of an image is analyzed by using a neural network, a density zone that is considered to be abnormal is eliminated from a luminance histogram, and the rest is regarded as an effective density zone. Then, reference density values (a shadow point and a highlight point) are calculated from the effective density zone.
The automatic exposure control mechanism of the digital camera controls the exposure in accordance with the brightness of the background, especially in a backlit scene. Thus, an object comes out dark. In addition, in night portrait photographing, the aperture and the shutter speed are fixed to respective predetermined values on the assumption that a strobe light illuminates the object. However, when the distance between the strobe light and the object is too great, the strobe light does not reach the object. The object comes out dark also in this case.
In order to correspond to such an incorrect exposure state in photographing to produce a digital image, techniques of automatically performing the gradation correction on the image data have been proposed. For example, Japanese Laid-Open Patent Application No. 2000-134467 proposes a technique that estimates whether an original image is a backlit image, a night strobe image or a normal exposure image from the shape of a luminance histogram, and performs a process according to the state. Additionally, Japanese Laid-Open Patent Application No. 09-037143 proposes a technique that recognizes a photographing condition (from backlight to excessive follow light) from photometric values of an object and a background so as to adjust the exposure. Further, Japanese Patent Publication No. 07-118786 proposes a technique of comparing an output signal of a center part of an imaged screen and that of a peripheral part, and continuously increasing the gain as the output of the peripheral part increases, or outputs a control signal that maintains the gain to be constant.
It should be noted that the exposure correction refers to adjusting the brightness of an object having inappropriate brightness with respect to a scene to a brightness suitable for the scene. For example, brightening an object that is entirely dark due to underexposure or an object that is dark due to backlight, or darkening an overexposed object. Generally, the exposure correction in the camera is performed by varying the aperture and the shutter speed so as to adjust the amount of incoming light that enters into a lens. Further, in printers and displays, the exposure correction refers to a process of optimizing the brightness of output signals with respect to that of input signals, by using an input/output conversion function (a linear or nonlinear gradation correction table). Adjusting the brightness of image data by correcting the exposure as mentioned above and the gradation correction process according to the present invention have the same object. Thus, in the following, both will be described as the gradation correction process.
In an image where the distribution of luminance is extremely skewed and no object exists other than a person, such as a portrait image photographed at night (hereinafter referred to as a “night portrait image”), when the dynamic range is set for the whole image as proposed in the Japanese Laid-Open Patent Application No. 10-198802, in a case where the object is small, the highlight point is set in the vicinity of the brightness that the object has. As a result, the gradation is destructed or deteriorated due to over-correction. With human visual acuity, the destruction of the gradation or the deterioration of the gradation is conspicuous in a highlight area having little color. Accordingly, color information is ignored when the highlight point is determined based only on the luminance histogram. Thus, the destruction of the gradation and hue variation may occur in an area having the above-mentioned characteristics.
Additionally, in the Japanese Laid-Open Patent Application No. 11-154235, the highlight point is calculated from the effective density area obtained by eliminating an abnormal area from a density histogram according to the scene. However, as in the Japanese Laid-Open Patent Application No. 10-198802, when the highlight area in which the destruction of the gradation stands out is small, the destruction of the gradation occurs with the correction.